<?php 
require_once('scripts/restrict_access.php');
if ($identity->accessLevel>10){
	header('Location: AccessDenied.php');
	exit;
}
require_once('scripts/user_registration.php');
require_once('scripts/library.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--

Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Title      : Complimentary
Version    : 1.0
Released   : 20080409
Description: A two-column, fixed-width and lightweight template ideal for 1024x768 resolutions. Suitable for blogs and small websites.

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>User Registration</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="CSS/ComplementaryDefault.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<!-- start header -->
<div id="header">
<div id="logo">
    <h1><a href="#">Find-it</a>
</h1></div><div id="menu">
    <div id="buttons">
      <ul>
        <li class="active"> <a href="DBList.php"> Catalogs </a></li>
        <a href="AddDataBase.php"> New Catalog
        <li></li>
        </a>
        </li>
        <li class="active"><a href="UserList.php">Users </a></li>
        <li></li>
        <li class="active"><a href="ReportList.php">Reports</a></li>
        <li><a href="Index.php?logout">Logout </a></li>
      </ul>
    </div>
  </div>
</div>
<!-- end header -->
<!-- start page -->
<div id="page">
  <!-- start content -->
  <div id="content">
    <div class="post">
      <p><br />
      </p>     
      
      <h1 class="title">User Registration</h1>
      <div class="searchfield"></div>
      <div class="entry">
        <form id="form1" method="post" action="">
          <span class="warning">
           <?php
           if ($_POST && isset($errors['lastName'])){
			   echo $errors['lastName'];
		   } ?>
          </span>
<label for="lastName">
           Last Name</label>
          <input name="lastName" type="text" id="lastName" size="50" maxlength="50"
          value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['lastName'],ENT_COMPAT, 'UTF-8');
		  }?>"
           />
          <br />
           <span class="warning">           
           <?php	if ($_POST && isset($errors['firstName'])){
	       echo $errors['firstName'];
		   }
		   ?>
           </span>
  <label for="firstName">
          First Name</label>
          <input value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['firstName'],ENT_COMPAT, 'UTF-8');
		  }?>" name="firstName" type="text" id="firstName" size="50" maxlength="50" /> 
          <br />
          
          <span class="warning">
			<?php	if ($_POST && isset($errors['email'])){
            echo $errors['email'];
            }
            ?>
          </span>
          <label for="email">email</label>
          <input value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['email'],ENT_COMPAT, 'UTF-8');
		  }?>" name="email" type="text" id="email" size="50" maxlength="100" />
          <br />
          <span class="warning">
			<?php	if ($_POST && isset($errors['confirmEmail'])){
			echo $errors['confirmEmail'];
			}
			?>
          </span>
  <label for="confirmEmail">Confirm Email</label>
          <input value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['confirmEmail'],ENT_COMPAT, 'UTF-8');
		  }?>" name="confirmEmail" type="text" id="confirmEmail" size="50" maxlength="100" />
          <br />
          <span class="warning">
			<?php	if ($_POST && isset($errors['userName'])){
			echo $errors['userName'];
			}
			?>
          </span>
          <label for="userName">User Name</label>
          <input value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['userName'],ENT_COMPAT, 'UTF-8');
		  }?>" name="userName" type="text" id="userName" size="50" maxlength="50" />
          <br />
          <span class="warning">            
			<?php	if ($_POST && isset($errors['password'])){
			echo $errors['password'];
			}
			?>
          </span>
          <label for="password">Password</label>
          <input value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['password'],ENT_COMPAT, 'UTF-8');
		  }?>" name="password" type="password" id="password" size="50" maxlength="50" />
          <br />
          <span class="warning">
			<?php	if ($_POST && isset($errors['confirmPassword'])){
			echo $errors['confirmPassword'];
			}
			?>
          </span>
          <label for="confirmPassword">Confirm Password</label>
          <input value="<?php if ($_POST && $errors){
			  echo htmlentities($_POST['confirmPassword'],ENT_COMPAT, 'UTF-8');
		  }?>" name="confirmPassword" type="password" id="confirmPassword" size="50" maxlength="50" />
          <br />
          <?php
			$sql = 'SELECT level, accesslevels.group from accesslevels';
			$result = $dbRead->fetchAll($sql);
			$numRows = count($result);
			?>
          <label for="accessLevel">Access Level</label>
          <select name="accessLevel" id="accessLevel">
            <?php
			for ($i=0;$i<$numRows;$i++){ ?>
				<option value=<?php echo $result[$i]['level']; ?> ><?php echo $result[$i]['group']; ?></option>
			<?php } ?>
          </select>
<br />
<input type="submit" name="submit" id="submit" value="Submit" />
        </form>
        <!-- The bottomSpace div is for reserving space at the bottom for the footer -->
        <div class="bottomSpace">
          <p><br /><br />
          </p>
        </div>
      </div>
      
    </div>
  </div>
  <!-- end content -->
  <!-- start sidebar --><!-- end sidebar -->
  <div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer">
  <p id="legal">(c) 2012 Find-It. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.<br />
	</p>
</div>
<!-- end footer -->
</body>
</html>